<#escape x as (x)!"">
package ${basePackage}.${platPackage}.${modulePackage}.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import ${basePackage}.utils.Query;

import java.util.List;
import java.util.Map;

import ${basePackage}.${platPackage}.${modulePackage}.dao.${className}Dao;
import ${basePackage}.entity.${modulePackage}.${className}Entity;
import ${basePackage}.${platPackage}.${modulePackage}.service.${className}Service;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;


@Service("${classname}Service")
@Transactional(readOnly = true)
public class ${className}Service{
	@Autowired
	private ${className}Dao ${classname}Dao;
	
	
	public ${className}Entity queryObject(${pk.attrType} ${pk.attrname}){
		return ${classname}Dao.queryObject(${pk.attrname});
	}
	
	
	public List<${className}Entity> queryList(Map<String, Object> map){
		return ${classname}Dao.queryList(map);
	}

    
	public Page<${className}Entity> queryPageList(Query query){
	    PageHelper.startPage(query.getPage(), query.getLimit());
	    return ${classname}Dao.queryPageList(query);
	}
	
	
	public int queryTotal(Map<String, Object> map){
		return ${classname}Dao.queryTotal(map);
	}
	
	
	@Transactional
	public void save(${className}Entity ${classname}){
		${classname}Dao.save(${classname});
	}
	
	
	@Transactional
	public void update(${className}Entity ${classname}){
		${classname}Dao.update(${classname});
	}
	
	
	@Transactional
	public void delete(${pk.attrType} ${pk.attrname}){
		${classname}Dao.delete(${pk.attrname});
	}
	
	
	@Transactional
	public void deleteBatch(${pk.attrType}[] ${pk.attrname}s){
		${classname}Dao.deleteBatch(${pk.attrname}s);
	}
}
</#escape>
